package ezXpns.tests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import ezXpns.analysis.Aggregator;
import ezXpns.analysis.aggregators.Sum;

import java.util.UUID;

import static org.mockito.Mockito.mock;


//@author A0086934R
public class SumTest {

	@Before
	public void setUp() {
		AggregatorMock = mock(Aggregator.class);
	}
	
	@Test
	public void testConstructor() {
		Sum S1 = new Sum();
		
		assertNotNull(S1);
	}
	
	@Test
	public void test() {
		Sum S2 = new Sum();
		UUID U2 = new UUID(4242L, 0L);
		Float F2 = 1.0f;
		
		S2.addEntry(U2, F2);
		assertTrue(S2.getResult() == 1);
		
		S2.removeEntry(U2, F2);
		assertTrue(S2.getResult() == 0);
	}

	Aggregator AggregatorMock;
}
